﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

using WCFMINERP.InnerFactoryContracts.DataContracts;
using System.Data;

namespace WCFMINERP.InnerFactoryContracts.InterFaces
{
    [ServiceContract]
    public interface IInnerFactory
    {
        /// <summary>
        /// 根据工厂代码获取产品列表
        /// </summary>
        /// <param name="inFactoryId"></param>
        /// <returns></returns>
        [OperationContract]
        List<ProduceView> NewGetProduceViewList(int inFactoryId);

        /// <summary>
        /// 用户验证
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        [OperationContract]
        UserInfo UserLogin(string userName, string pwd);

        /// <summary>
        /// 通过激活码获得对应的委外商信息
        /// </summary>
        /// <param name="activeCode"></param>
        /// <returns></returns>
        [OperationContract]
        OutProcessShop_Info GetOutShopByActiveCode(string activeCode);


        /// <summary>
        /// 通过委外商Id获得委外商
        /// </summary>
        /// <param name="outShopId"></param>
        /// <returns></returns>
        [OperationContract]
        OutProcessShop_Info GetOutShopById(int outShopId);

        /// <summary>
        /// 通过产品条码获得委外记录
        /// </summary>
        /// <param name="productBarCode"></param>
        /// <returns></returns>
        [OperationContract]
        OutProcessRecord_Info GetReCordByCode(string productBarCode);


         /// <summary>
        /// 开始生产
        /// </summary>
        /// <param name="inUser"></param>
        /// <param name="inStrErr"></param>
        /// <param name="inoutRecordId"></param>
        [OperationContract]
        void StartProduce(int inUser, int inoutRecordId);


        /// <summary>
        /// 结束生产
        /// </summary>
        /// <param name="inUser"></param>
        /// <param name="inStrErr"></param>
        /// <param name="inoutRecordId"></param>
        [OperationContract]
        void EndProduce(int inUser, int inoutRecordId);

         /// <summary>
        /// 出错暂停生产
        /// </summary>
        /// <param name="inUser"></param>
        /// <param name="inoutRecordId"></param>
        /// <param name="inStrErr"></param>
        [OperationContract]
        void PauseProduce(int inUser, string inOutBarCode, string inStrErr);

        /// <summary>
        /// 恢复生产
        /// </summary>
        /// <param name="inUser"></param>
        /// <param name="inStrErr"></param>
        /// <param name="inoutRecordId"></param>
        [OperationContract]
        void RebootProduce(int inUser, int inoutRecordId);

        /// <summary>
        ///获取打印信息
        /// </summary>
        /// <param name="barcode"></param>
        /// <returns></returns>
        [OperationContract]
        DataTable GetPrintInfo(string barcode);
        [OperationContract]
        DataTable GetPrintInfoByPhoto(string barcode);
        /// <summary>
        ///获取打印信息--照片条码
        /// </summary>
        /// <param name="barcode"></param>
        /// <returns></returns>
        [OperationContract]
        ProduceView GetProduceViewByPhotoCode(string photoBarcode);

         
        /// <summary>
        /// 取得打印报表数据
        /// </summary>
        /// <param name="inGridId"></param>
        /// <param name="inProduct"></param>
        [OperationContract]
        DataSet GetReportdata(string inProduct, string inGridName);


         /// <summary>
        /// 检查产品是否存在
        /// </summary>
        /// <param name="productCode"></param>
        /// <returns></returns>
        [OperationContract]
        bool IsProductExist(string productCode);


        
        /// <summary>
        /// 检查照片是否存在
        /// </summary>
        /// <param name="productCode"></param>
        /// <returns></returns>
        [OperationContract]
        bool IsPhotoExist(string photoBarCode);


        /// <summary>
        /// 通过节点类型获得节点Id
        /// </summary>
        /// <param name="techType"></param>
        /// <returns></returns>
        [OperationContract]
        int GettechId(int techType);


         /// <summary>
         /// 扫描接收
         /// </summary>
         /// <param name="barCode"></param>
         /// <param name="OperateUid"></param>
         /// <param name="techId"></param>
         /// <param name="errorMsg"></param>
        /// <returns>0接收成功，1产品全部流程已完成，2产品有错误，3产品生产停止，4产品生产完成，5未知异常，6此产品还未到达本岗位,没有找到状态为1的结点
        /// 7没有找到此产品的相关委外记录,请确认这个产品的流程是否正确!,8该产品未到本岗位，请到客服产看该产品信息!,9在委外记录表中未找到此产品的相关的委外的记录!
        /// 
        /// </returns>
        [OperationContract]
        int ReceiveBarCode(string barCode, int OperateUid, int techId, out string errorMsg, out OrderInfo_Info orderInfo);

        /// <summary>
        /// 打印账单
        /// </summary>
        /// <param name="curTechId"></param>
        /// <param name="operUid"></param>
        /// <param name="SelectOrderInfo"></param>
        /// <param name="hasForcibePrint"></param>
        /// <param name="inPay"></param>
        /// <returns></returns>
        [OperationContract]
        SHOP_Bill_Info PrintShopBill(int curTechId, int operUid, List<OrderInfo_Info> SelectOrderInfo, bool hasForcibePrint, int inPay);
        /// <summary>
        /// 根据照片条码获取view
        /// </summary>
        /// <param name="inFactoryId"></param>
        /// <param name="OutProcessRecordId"></param>
        /// <returns></returns>
      

        [OperationContract]
        ProduceView GetProduceViewByOrderCode(string orderBarcode);  
    }
}
